#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/7/6 20:35
# @Author : 闫峰
# @File    : csv_utils.py
import csv


class CsvUtils:

    def __init__(self, file_path):
        self.file = file_path

    # 打开CSV文件
    def read_csv(self):
        with open(self.file, 'r') as file:
            # 读取CSV文件数据
            reader = csv.reader(file, delimiter='\t')
            csv_data = list(reader)
        return csv_data

    def write_csv(self, data):
        with open(self.file, 'w', newline='') as file:
            writer = csv.writer(file)
            writer.writerows(data)


if __name__ == '__main__':
    pass
